eloquent with select

107

eloquent with select -

Post::query()
    ->with(array('user' => function($query) {
        $query->select('id','username');
    }))
    ->get();

Comments

Submit
0 Comments